IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SrvrInstncEAV]') AND type in (N'U'))
BEGIN
     DROP TABLE [dbo].[SrvrInstncEAV]
END
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[SrvrInstncEAV](
     [SrvrInstncId]     [int]           NOT NULL,
     [ParameterId]      [int]           NOT NULL,
     [ParameterMultiId] [int]           NOT NULL CONSTRAINT [DF_SrvrInstncEAV_ParameterMultiId] DEFAULT ((0)),
     [ParameterValue]   [varchar](8000)     NULL,
     [LastModDt]        [datetime]      NOT NULL CONSTRAINT [DF_SrvrInstncEAV_LastModDt] DEFAULT (getdate()),
     CONSTRAINT [PK_SrvrInstncEAV] PRIMARY KEY CLUSTERED ( [SrvrInstncId] ASC, [ParameterId] ASC, [ParameterMultiId] ASC )
) ON [PRIMARY]
GO

SET ANSI_PADDING OFF
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Unique Identifier of a particular Database Server Instance.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SrvrInstncEAV', @level2type=N'COLUMN',@level2name=N'SrvrInstncId'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Unique Identifier of a particular Parameter.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SrvrInstncEAV', @level2type=N'COLUMN',@level2name=N'ParameterId'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Unique Identifier of a particular record for the specified database server instance and parameter.  This is used to make the record unique.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SrvrInstncEAV', @level2type=N'COLUMN',@level2name=N'ParameterMultiId'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Value of the parameter for the specified database server instance.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SrvrInstncEAV', @level2type=N'COLUMN',@level2name=N'ParameterValue'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The last date/time the record was changed.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SrvrInstncEAV', @level2type=N'COLUMN',@level2name=N'LastModDt'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Server instance Entity-Attribute-Values for multiple entries per parameter and server instance if.  Contains key-value pairs for a particular server instance id but allows more than one value for a parameter to be stored.  Use of this table is controlled by whether a parameter allows multiple values to be stored.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SrvrInstncEAV'
GO
